<template>
	<div>
		<input type="file" ref="fileImg" @change="fileFn" accept="image/*" class="none" />
	</div>
</template>
<script>
	export default{
		data(){
			return{
				carVin:{},
			}
		},
		methods:{
			filePost(Url){
		      	let instance = axios.create({      			headers:{
		      			'Authorization':'DP92m1bWVrMOm/xAZjfZQqQIhpxhPTEwMTI1NDE4Jms9QUtJRHBZQm1EVGY4YTlkdzQwNHJmSnJzbVdDNE5XVU1iOW9JJmU9MTUyODk1NTg2NCZ0PTE1MjYzNjM4NjMmcj0zODE5NDY0MDUxJnU9NjIzNjMwMzAy',
		      			'content-type':'text/json'
		      	},
		       });
				instance({
		            method: 'post',
		            url: 'https://api.youtu.qq.com/youtu/ocrapi/driverlicenseocr',
		            data: {
		            	"type":0,
		            	"app_id":"10125418",
		            	"url":Url
		            }
		        }).then(res => {
		        	this.$refs.fileImg.value = '' 
		        	if(res){
				 		res.data.items.map(item=>{if(item.item=='识别代码'){this.carVin = item.itemstring}})
				 	}
				}).catch(err=>{
					this.$refs.fileImg.value = '' 
					setTimeout(()=>{
						$toast.show('服务器繁忙,请稍后再试',2000);
					},400)
					
				})
		    },
		},
	}
</script>
